<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="examination.AccountBean"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>长安大学考务管理系统</title>
	<link rel="stylesheet" href="layui/css/layui.css">
	<script src="layui/layui.all.js"></script>
</head>
<body class="layui-layout-body">
<%
	//如果没登录则先登录
	AccountBean account = (AccountBean)session.getAttribute("account");
	
	if(account==null){
		%>
		<script>
		layui.use('layer', function(){
			  var layer = layui.layer;
			  layer.alert('请先登录', function(index){
					window.location.href="login.jsp";
				}); 
			});  
		</script>
		<%	
		return;//不继续向下执行
	}

%>
	<div class="layui-layout layui-layout-admin">
	  <div class="layui-header">
		<div class="layui-logo">长安大学考务管理系统</div>
		<!-- 头部区域（可配合layui已有的水平导航） -->
		
		<ul class="layui-nav layui-layout-right">
		  <li class="layui-nav-item">
			<a href="javascript:;">
			  <img src="https://s2.ax1x.com/2019/12/30/lQghKH.jpg" class="layui-nav-img">
			 
			 <%=account.getUsername()%>
			</a>
			<dl class="layui-nav-child">
			  <dd><a href="">基本资料</a></dd>
			  <dd><a href="">安全设置</a></dd>
			</dl>
		  </li>
		  <li class="layui-nav-item"><a href="login.jsp?logout=true">注销</a></li>
		</ul>
	  </div>
	  
	  <div class="layui-side layui-bg-black">
		<div class="layui-side-scroll">
		  <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
		  	<ul class="layui-nav layui-nav-tree" lay-filter="test">
		  	<%
		  		if(account.getType()==1){
		  			%>
		  			<li class="layui-nav-item">
		  				<a href="exam_info.jsp" target="frame">考试信息一览表</a>
		  			</li>
					<li class="layui-nav-item">
						<a href="audit_list.jsp" target="frame">待审核考试</a>
					</li>
					<li class="layui-nav-item">
						<a href="invigilation_list.jsp" target="frame">监考一览表</a>
					</li>
		  			
		  			<% 
		  		}
		  		else{
		  			%>
		  			
					
					<li class="layui-nav-item">
		  				<a href="exam_info.jsp" target="frame">考试信息一览表</a>
		  			</li>
					<li class="layui-nav-item">
						<a href="exam_apply_form.jsp" target="frame">考试申请表单</a>
					</li>
					<li class="layui-nav-item">
						<a href="invigilation_list.jsp" target="frame">监考一览表</a>
					</li>
					<li class="layui-nav-item">
						<a href="invigilation_detail.jsp?staffNo=<%=account.getStaffNo() %>" target="frame">我的监考</a>
					</li>
					<li class="layui-nav-item">
						<a href="apply_list.jsp?staffNo=<%=account.getStaffNo() %>" target="frame">我的考试申请</a>
					</li>
		  			<% 
		  		}
		  	
		  	
		  	%>
		  	
			</ul> 
		</div>
	  </div>
	  
	  <div class="layui-body">
		<!-- 内容主体区域 -->
		<iframe src="exam_info.jsp" name="frame" width=100% height=100% id="content"></iframe>
	  </div>
	  
	  <div class="layui-footer">
	  </div>
	</div>
	
	
	 
	 
</body>
</html>